<template>
  <div id="equip-line">
    <div class="tab-title">历史曲线</div>
    <div class="tab-btn">
      <el-form
        :inline="true"
        :model="formInline"
        class="demo-form-inline"
        size="mini"
      >
        <el-form-item label="起始日期">
          <el-date-picker
            v-model="formInline.Sdate"
            type="date"
            placeholder="筛选"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="结束日期">
          <el-date-picker
            v-model="formInline.Edate"
            type="date"
            placeholder="筛选"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="设备">
          <el-select v-model="formInline.region" placeholder="设备">
            <el-option label="设备一" value="shanghai"></el-option>
            <el-option label="设备二" value="beijing"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item style="float: right">
          <el-button type="primary" size="mini" class="add">查询</el-button>
        </el-form-item>
      </el-form>
    </div>
    <!-- 曲线 -->
    <div id="History-line">
      <!-- 局放历史曲线 -->
      <div id="Partial">
        <div class="top">局放历史曲线</div>
        <div id="ParticalLine"></div>
      </div>
      <!-- 铁芯历史曲线 -->
      <div id="Iron">
        <div class="top">铁芯历史曲线</div>
        <div id="IronLine"></div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: "equipLine",
  components: {},
  props: {},
  data() {
    return {
      formInline: {
        Sdate: "",
        Edate: "",
        region: "",
      },
      xDataArr: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
      yDataArr: ["招商银行", "浦发银行", "广发银行", "上海银行"],
    };
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {
    this.getPartial();
  },
  methods: {
    getPartial() {
      var myChart = this.$echarts.init(document.getElementById("ParticalLine"));
      //   var myChart = this.$echarts.init(document.getElementById("IronLine"));
      // option将要设置以下字段感觉就足够使用了
      var option = {
        legend: { data: ["招商银行", "浦发银行", "广发银行", "上海银行"] },
        xAxis: {
          type: "category", // 还有其他的type，可以去官网喵两眼哦
          data: this.xDataArr, // x轴数据
          //   name: "日期", // x轴名称
          // x轴名称样式
          //   nameTextStyle: {
          //     fontWeight: 600,
          //     fontSize: 18,
          //   },
        },
        yAxis: {
          type: "value",
          //   name: "纵轴名称", // y轴名称
          // y轴名称样式
          //   nameTextStyle: {
          //     fontWeight: 600,
          //     fontSize: 18,
          //   },
        },
        label: {},
        tooltip: {
          trigger: "axis", // axis   item   none三个值
        },
        grid: {
          show: true,
          left: "15%",
          top: "25%",
          right: "10%",
          bottom: "15%",
        },
        series: [
          // { type: "line", data: this.yDataArr }
          {
            name: "招商银行",
            data: [820, 932, 901, 934, 1290, 1330, 1320],
            type: "line",
          },
          {
            name: "浦发银行",
            data: [620, 711, 823, 934, 1445, 1456, 1178],
            type: "line",
          },
          {
            name: "广发银行",
            data: [612, 920, 1140, 1160, 1190, 1234, 1321],
            type: "line",
          },
          {
            name: "上海银行",
            data: [234, 320, 453, 567, 789, 999, 1200],
            type: "line",
          },
        ],
      };
      myChart.setOption(option);
    },
  },
};
</script>
<style scoped>
#equip-line {
  width: 82%;
  height: 90%;
  float: right;
  margin: 15px 15px 0 0;
  background: #1144ab;
  border: 1px solid #669dff;
}
.tab-title {
  width: 100%;
  height: 5%;
  background: #0f3071;
}
.add {
  background: #1077cf;
  border: 1px solid #0372d5;
  border-radius: 3px;
  color: #fff;
}
.tab-btn {
  margin: 20px 20px 0 20px;
}
#equip-line ::v-deep .el-form-item__label {
  color: #fff;
  font-size: 16px;
}
#equip-line ::v-deep .el-input__inner {
  border: 1px solid #40beff;
  height: 28px;
  width: 200px;
  background: transparent;
}
#History-line {
  width: 96%;
  height: 80%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
}
#Partial,
#Iron {
  width: 100%;
  height: 45%;
  background: rgba(17, 68, 171, 0.7);
  border: 1px solid #669dff;
}
#Partial .top,
#Iron .top {
  background: #0f3071;
  height: 15%;
  font-size: 16px;
}
#Partial #ParticalLine,
#Iron #IronLine {
  width: 100%;
  height: 85%;
}
</style>
